﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
	CodeFile="ReportsGrid.aspx.cs" Inherits="Reports_Grid" Title="Untitled Page" %>

<%@ MasterType VirtualPath="~/MasterPage.master" %>
<%@ Register Namespace="NS_Controls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderContent" runat="Server">
<link href="../Styles/themes/linkedin/tabs.css" rel="stylesheet" type="text/css" />
<link href="../Styles/themes/linkedin/blue/linkedin-blue.css" rel="stylesheet" type="text/css" />
	<asp:UpdatePanel ID="up1" runat="server">
		<ContentTemplate>
			<asp:TextBox ID="txtLastTab" runat="server" Style="display: none" />
			<ajaxToolKit:TabContainer ID="TabContainer1" runat="server" OnActiveTabChanged="TabContainer1_ActiveTabChanged"
				OnClientActiveTabChanged="TabContainer1_ClientActiveTabChanged" CssClass="linkedin linkedin-blue">
				<ajaxToolKit:TabPanel runat="server" ID="tab1" HeaderText="<%$ Resources:GridView, ReportsList %>">
					<ContentTemplate>
						<h2 class="RptTitle">
							<% =Resources.GridView.ReportsList %></h2>
						<br />
						<br />
						<asp:Repeater ID="RepeaterGroups" runat="server">
							<HeaderTemplate>
								<table border="1" class="clsTable" cellpadding="3" cellspacing="0" width="98%">
									<tr>
										<th class="RptHeader" style="width: 300px; border-right: 0; border-left: 0">
											<% =Resources.GridView.Report %>
										</th>
										<th class="Explicatii">
											<% =Resources.GridView.Explanations %>
										</th>
									</tr>
							</HeaderTemplate>
							<ItemTemplate>
								<tr runat="server" id="trModul" class="clsBlack" visible='<%# (GetDataSource(Eval("ID").ToString()).Count > 0) %>'>
									<td style="border-right: 0; border-left: 0">
										<b>
											<%# Eval("[Name_" + Tools.GetLanguage(Request) + "]")%></b>
									</td>
									<td style="border-left: 0">
										<%# Eval("[Description_" + Tools.GetLanguage(Request) + "]")%>
									</td>
								</tr>
								<asp:Repeater ID="RepeaterReports2" runat="server" DataSource='<%# GetDataSource(Eval("ID").ToString()) %>'>
									<ItemTemplate>
										<tr class="clsTableReportTr">
											<td>
												<asp:LinkButton ID="lbSelectReport" runat="server" CssClass="aLink" OnClick="lbSelectReport_Click"
													CommandArgument='<%# Eval("[ID]") %>' Text='<%# Eval("[Name_" + Tools.GetLanguage(Request) + "]") %>' />
											</td>
											<td>
												<span class="Explicatii">
													<%# (Eval("[Description_" + Tools.GetLanguage(Request) + "]") == System.DBNull.Value ? "&nbsp;" : Eval("[Description_" + Tools.GetLanguage(Request) + "]"))%></span>
											</td>
										</tr>
									</ItemTemplate>
								</asp:Repeater>
							</ItemTemplate>
							<FooterTemplate>
								</table>
							</FooterTemplate>
						</asp:Repeater>
						<br />
					</ContentTemplate>
				</ajaxToolKit:TabPanel>
				<ajaxToolKit:TabPanel runat="server" ID="tab2" HeaderText="<%$ Resources:GridView, ReportCriterias %>">
					<ContentTemplate>
						<h2 class="RptTitle">
							<asp:Label ID="lblRptName" runat="server"></asp:Label></h2>
						<br />
						<span class="Explicatii">
							<asp:Label ID="lblDescription" runat="server"></asp:Label></span>
						<br />
						<br />
						<asp:Table runat="server" ID="tblCriterias" CssClass="clsTable" CellPadding="3" CellSpacing="0">
							<asp:TableRow>
								<asp:TableHeaderCell ColumnSpan="3" CssClass="RptHeader" Wrap="false"><% =Resources.GridView.ReportCriterias %></asp:TableHeaderCell>
							</asp:TableRow>
							<asp:TableRow>
								<asp:TableCell ColumnSpan="3" HorizontalAlign="Center" Wrap="false">
									<asp:Button ID="btnView" runat="server" Text="<%$ Resources:GridView, ViewReport %>"
										OnClick="btnView_Click" OnClientClick="OnClick_btnViewReport();" />
									&nbsp;&nbsp;&nbsp;
									<asp:Button ID="btnReset" runat="server" Text="<%$ Resources:GridView, Reset %>"
										OnClick="OnClick_btnReset" />
								</asp:TableCell>
							</asp:TableRow>
						</asp:Table>
					</ContentTemplate>
				</ajaxToolKit:TabPanel>
				<ajaxToolKit:TabPanel runat="server" ID="tab3" HeaderText="<%$ Resources:GridView, ReportDisplay %>">
					<ContentTemplate>
						<h2 class="RptTitle">
							<asp:Label ID="lblRptName2" runat="server"></asp:Label></h2>
						&nbsp; &nbsp;<asp:Label ID="lblReportTime" runat="server" CssClass="Explicatii" />
						&nbsp; &nbsp;<asp:Label ID="lblRptID" runat="server" CssClass="Explicatii" Style="display: none"></asp:Label>
						<br />
						<span class="Explicatii">
							<asp:Label ID="lblDescription2" runat="server"></asp:Label></span> &nbsp; &nbsp;<asp:Label
								ID="lblCriterias" runat="server" CssClass="Explicatii"></asp:Label>
						<br />
						<br />
						<cc1:ExtendedGridView runat="server" ID="GridViewReportDetails" UseDefaultStyle="true" ShowEditLink="false" ShowInsertLink="false"
							AllowSorting="true" TranslateColumnHeaders="true" EnableFilter="true" EnablePageSize="true"
							EnableExport="true" />
						<asp:Label ID="lblExplanations" runat="server" CssClass="Explicatii" />
					</ContentTemplate>
				</ajaxToolKit:TabPanel>
			</ajaxToolKit:TabContainer>
		</ContentTemplate>
	</asp:UpdatePanel>

	<script type="text/javascript">
		function DisableReportParamsButtons() {
			$get('<% =btnView.ClientID %>').disabled = true;
			$get('<% =btnReset.ClientID %>').disabled = true;
		}

		function OnClick_btnViewReport() {
			DisableReportParamsButtons();
			$get('<% =btnView.ClientID %>').value = '<% =Resources.GridView.LoadingReport %>';
			__doPostBack('<% =btnView.UniqueID %>', '');
		}

		function TabContainer1_ClientActiveTabChanged(sender, e) {
			if (sender.get_activeTabIndex() == 0)
				$get('<% =txtLastTab.ClientID %>').value = sender.get_activeTabIndex();
			else
				__doPostBack('<% =TabContainer1.UniqueID %>', sender.get_activeTabIndex());
		}
	</script>

</asp:Content>
